package routers

import (
	"mini-app/internal/app/admin/controller"
	"mini-app/internal/app/admin/middleware"

	"github.com/gin-gonic/gin"
)

// adminGroup 后台管理路由
func adminGroup(rg *gin.RouterGroup) {
	rg.Use(middleware.ParamsHandle())
	rg.GET("/device/list", controller.Device{}.List)
	rg.GET("/goods/list", controller.Goods{}.List)
	rg.POST("/goods/set", controller.Goods{}.Set)
	rg.POST("/goods/set-visible", controller.Goods{}.SetVisible)
	rg.GET("/goods/list-goods-setting", controller.Goods{}.ListGoodsSetting)
	rg.POST("/goods/class/add", controller.GoodsClass{}.Add)
	rg.POST("/goods/class/update", controller.GoodsClass{}.Update)
	rg.POST("/goods/class/delete", controller.GoodsClass{}.Delete)
	rg.GET("/goods/class/list", controller.GoodsClass{}.List)
	rg.POST("/promotion-channel/add", controller.PromotionChannel{}.Add)
	rg.POST("/promotion-channel/update", controller.PromotionChannel{}.Update)
	rg.POST("/promotion-channel/delete", controller.PromotionChannel{}.Delete)
	rg.GET("/promotion-channel/list", controller.PromotionChannel{}.List)
	rg.GET("/promotion-channel/assigned-robots", controller.PromotionChannel{}.AssignedRebotIDs)
	rg.GET("/order/list", controller.Order{}.List) // 订单列表
	// 会员列表
	rg.POST("/user/list", controller.User{}.List)
	// 线上活动
	rg.POST("/online-event/create", controller.OnlineEvent{}.Create)
	rg.POST("/online-event/update", controller.OnlineEvent{}.Update)
	rg.POST("/online-event/delete", controller.OnlineEvent{}.Delete)
	rg.GET("/online-event/list", controller.OnlineEvent{}.List)
	rg.GET("/online-event/detail", controller.OnlineEvent{}.Detail)
	rg.POST("/online-event/set-visible", controller.OnlineEvent{}.SetVisible)
	rg.POST("/online-event/winner/config", controller.OnlineEvent{}.WinnerConfig)
	rg.GET("/online-event/winner/list", controller.OnlineEvent{}.WinnerList)
	rg.GET("/online-event/user-list", controller.OnlineEvent{}.UserList)
	rg.GET("/online-event/selected-user-list", controller.OnlineEvent{}.SelectedUserList)

	rg.POST("/online-event/set-top", controller.OnlineEvent{}.SetTop)
	rg.POST("/online-event/cancel-top", controller.OnlineEvent{}.CancelTop)
	rg.POST("/online-event/set-sort", controller.OnlineEvent{}.SetSort)

	rg.POST("/online-event/draw", controller.OnlineEvent{}.Draw) // 开奖
	// 公告管理
	rg.POST("/announcement/create", controller.Announcement{}.Create)
	rg.POST("/announcement/update", controller.Announcement{}.Update)
	rg.POST("/announcement/delete", controller.Announcement{}.Delete)
	rg.GET("/announcement/list", controller.Announcement{}.List)
	rg.GET("/announcement/detail", controller.Announcement{}.Detail) // 公告详情
	// 评测
	rg.GET("/goods-review/list", controller.GoodsReview{}.List)               // 评测列表
	rg.POST("/goods-review/audit", controller.GoodsReview{}.Audit)            // 评测审核
	rg.POST("/goods-review/set-visible", controller.GoodsReview{}.SetVisible) // 评测显示设置
	rg.GET("/goods-review/audit-log", controller.GoodsReview{}.AuditLog)      // 审核日志
	rg.POST("/goods-review/update", controller.GoodsReview{}.Update)          // 更新评测
	// banner管理
	rg.POST("/banner/create", controller.Banner{}.Create)
	rg.POST("/banner/update", controller.Banner{}.Update)
	rg.POST("/banner/delete", controller.Banner{}.Delete)
	rg.GET("/banner/detail", controller.Banner{}.Detail)
	rg.GET("/banner/list", controller.Banner{}.List)
	rg.POST("/banner/online", controller.Banner{}.Online)
	rg.POST("/banner/offline", controller.Banner{}.Offline)

	//马甲用户
	{
		rg.POST("/puppet-user/puppet-user-edit", controller.PuppetUser{}.Edit)     // 编辑马甲用户
		rg.GET("/puppet-user/puppet-user-list", controller.PuppetUser{}.List)      // 马甲用户列表
		rg.POST("/puppet-user/puppet-user-create", controller.PuppetUser{}.Create) // 新增马甲用户
		rg.POST("/puppet-user/puppet-user-update", controller.PuppetUser{}.Update) // 更新马甲用户信息
		rg.GET("/puppet-user/puppet-user-detail", controller.PuppetUser{}.Detail)  // 马甲用户详情
		rg.POST("/puppet-user/puppet-user-delete", controller.PuppetUser{}.Delete) // 新增马甲用户
	}
}
